package com.ht.system.service.impl;

import java.util.List;

import javax.validation.constraints.NotEmpty;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ht.common.core.enums.UserStatus;
import com.ht.common.core.exception.ServiceException;
import com.ht.common.core.utils.DateUtils;
import com.ht.common.core.utils.StringUtils;
import com.ht.common.security.utils.SecurityUtils;
import com.ht.system.domain.EnterpriseInfo;
import com.ht.system.domain.EnterpriseOper;
import com.ht.system.domain.SysUser;
import com.ht.system.mapper.EnterpriseOperMapper;
import com.ht.system.service.IEnterpriseInfoService;
import com.ht.system.service.IEnterpriseOperService;
import com.ht.system.service.ISysUserService;

/**
 * 企业操作员Service业务层处理
 *
 * @author zmx
 * @date 2025-03-22
 */
@Service
public class EnterpriseOperServiceImpl implements IEnterpriseOperService
{
    @Autowired
    private EnterpriseOperMapper enterpriseOperMapper;
    /**
     * 查询企业操作员
     *
     * @param id 企业操作员主键
     * @return 企业操作员
     */
    @Override
    public EnterpriseOper selectEnterpriseOperById(String id)
    {
        return enterpriseOperMapper.selectEnterpriseOperById(id);
    }

    /**
     * 查询企业操作员列表
     *
     * @param enterpriseOper 企业操作员
     * @return 企业操作员
     */
    @Override
    public List<EnterpriseOper> selectEnterpriseOperList(EnterpriseOper enterpriseOper)
    {
        return enterpriseOperMapper.selectEnterpriseOperList(enterpriseOper);
    }

    /**
     * 新增企业操作员
     *
     * @param enterpriseOper 企业操作员
     * @return 结果
     */
    @Override
    public int insertEnterpriseOper(EnterpriseOper enterpriseOper)
    {
        enterpriseOper.setCreateTime(DateUtils.getNowDate());
        return enterpriseOperMapper.insertEnterpriseOper(enterpriseOper);
    }



	/**
     * 修改企业操作员
     *
     * @param enterpriseOper 企业操作员
     * @return 结果
     */
    @Override
    public int updateEnterpriseOper(EnterpriseOper enterpriseOper)
    {
        enterpriseOper.setUpdateTime(DateUtils.getNowDate());
        return enterpriseOperMapper.updateEnterpriseOper(enterpriseOper);
    }

    /**
     * 批量删除企业操作员
     *
     * @param ids 需要删除的企业操作员主键
     * @return 结果
     */
    @Override
    public int deleteEnterpriseOperByIds(@NotEmpty(message="参数不能为空") String[] ids)
    {

    	int delRes=0;
    	for (String id : ids) {
    		delRes+=deleteEnterpriseOperById(id);
		}
        return delRes;
    }

    /**
     * 删除企业操作员信息
     *
     * @param id 企业操作员主键
     * @return 结果
     */
    public int deleteEnterpriseOperById(String id)
    {
        return enterpriseOperMapper.deleteEnterpriseOperById(id);
    }

    @Override
    public List<EnterpriseOper> selectByEntCode(String entCode) {
        return this.enterpriseOperMapper.selectByEntCode(entCode);
    }
}
